﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DotNet.WinUI.Basic
{
    public partial class FrmBasic : Form
    {
        public FrmBasic()
        {
            InitializeComponent();
        }

        private void btnQuZF_Click(object sender, EventArgs e)
        {
            if (txtZiF.Text.Length >= 9)
            {
                lbZiF.Text = txtZiF.Text.Substring(3, 6);
            }
            else if (txtZiF.Text.Length > 3 && txtZiF.Text.Length < 9)
            {
                lbZiF.Text = txtZiF.Text.Substring(3);
            }
            else
            {
                lbZiF.Text = "字符太短，取不了！";
            }
        }

        private void rdbMan_Click(object sender, EventArgs e)
        {
            if (rdbMan.Checked)
            {
                pnFemale.Visible = false;

                pnMan.Visible = true;
                pnMan.Dock = DockStyle.Fill;
            }
        }

        private void rdbFemale_Click(object sender, EventArgs e)
        {
            if (rdbFemale.Checked)
            {
                pnMan.Visible = false;

                pnFemale.Visible = true;
                pnFemale.Dock = DockStyle.Fill;
            }
        }

        private void btnXuanZ_Click(object sender, EventArgs e)
        {
            txtSinger.Text = "";
            string _Singer = "";
            if(checkBox1.Checked == true)
            {
                _Singer += checkBox1.Text + "\n";
            }

            if (checkBox2.Checked == true)
            {
                _Singer += checkBox2.Text + "\n";
            }

            if (checkBox3.Checked == true)
            {
                _Singer += checkBox3.Text + "\n";
            }

            if (checkBox4.Checked == true)
            {
                _Singer += checkBox4.Text + "\n";
            }

            if (checkBox5.Checked == true)
            {
                _Singer += checkBox5.Text + "\n";
            }

            txtSinger.Text = _Singer;
        }

        private void tmTime_Tick(object sender, EventArgs e)
        {
            txtTime.Text = DateTime.Now.ToString("HH:mm:ss");
        }

        private void txtLength_TextChanged(object sender, EventArgs e)
        {
            lbLength.Text = "输入的字符长度为： " +txtLength.Text.Length.ToString();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            txtCut.Cut();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            txtCut.Copy();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            txtPaste.Paste();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            string _Singer = "";
            if (checkBox11.Checked == true)
            {
                _Singer += checkBox11.Text + "\n";
            }
            if (checkBox12.Checked == true)
            {
                _Singer += checkBox12.Text + "\n";
            }
            if (checkBox13.Checked == true)
            {
                _Singer += checkBox13.Text + "\n";
            }
            if (checkBox14.Checked == true)
            {
                _Singer += checkBox14.Text + "\n";
            }
            if (checkBox15.Checked == true)
            {
                _Singer += checkBox15.Text + "\n";
            }
            if (checkBox16.Checked == true)
            {
                _Singer += checkBox16.Text + "\n";
            } 
            
            MessageBox.Show("你选择的歌手是：" + _Singer, "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information).ToString();
        }
    }
}